package teleradiologia.service;

import teleradiologia.domain.Diagnosys;
import teleradiologia.domain.Doctor;
import teleradiologia.domain.Ordering;
import teleradiologia.repository.AddressDao;
import teleradiologia.repository.DiagnosysDao;
import teleradiologia.repository.DoctorDao;
import teleradiologia.repository.OrderingDao;

public class DiagnosysManipulatorImpl implements DiagnosysManipulator {
	private DiagnosysDao diagnosysDao;
	private DoctorDao doctorDao;
	private OrderingDao orderingDao;


	public void setDoctorDao(DoctorDao doctorDao) {
		this.doctorDao = doctorDao;
	}

	public void setOrderingDao(OrderingDao orderingDao) {
		this.orderingDao = orderingDao;
	}

	@Override
	public void delete(Diagnosys diagnosys) {
		this.diagnosysDao.delete(diagnosys);
	}

	@Override
	public Diagnosys getById(long id) {
		return this.diagnosysDao.getById(id);
	}

	@Override
	public void setDiagnosysDao(DiagnosysDao diagnosysDao) {
		this.diagnosysDao = diagnosysDao;
	}

	@Override
	public void update(Diagnosys diagnosys) {
		this.diagnosysDao.update(diagnosys);
	}

	@Override
	public long create(Diagnosys diagnosys, Doctor doctor, Ordering ordering) {
		
		diagnosys.setDoctor(doctor);
		diagnosys.setOrdering(ordering);

		return this.diagnosysDao.create(diagnosys);
	}

	@Override
	public Diagnosys getByIdOrdering(long idOrdering) {
		return this.diagnosysDao.getByIdOrdering(idOrdering);
	}

}
